package com.lst.api.interceptor;

import com.lst.tools.custom.context.BaseContextHandler;
import org.apache.log4j.Logger;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 客户端token拦截器
 *
 * @author: Frank
 * @date: 2017/12/18 17:51
 * @version: V1.0
 */
@Configuration
public class ClientInterceptor extends HandlerInterceptorAdapter {

    private static final Logger LOGGER = Logger.getLogger(ClientInterceptor.class);

    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        BaseContextHandler.remove();
        super.postHandle(request, response, handler, modelAndView);
    }
}
